/*
 * @include /winter/web/res/script/common/util.js
 * */
var UserInfo = function() {
	this.userId = null;
	this.userName = null;
	this.firstName = null;
	this.loginPwd = null;
	this.loginEmail = null
}

jQuery(function(aaa) {
	var user1 = new UserInfo();
	user1.userName = "userName111";
	user1.userId = 111111;

	var user2 = new UserInfo();
	user2.userName = "userName222";
	user2.userId = 222222;

	var users = [];
	users.push(user1);
	users.push(user2);

	var userStr = $.toJSON(user1);
	var usersStr = $.toJSON(users);

	function getUser() {
		jQuery.ajax({
			type : 'POST',
			contentType : 'application/json',
			url : '/demo/user',
			data : userStr,
			dataType : 'json',
			success : function(data) {
				alert(dwr.util.toDescriptiveString(data, 3));
			},
			error : function() {
				alert("error");
			}
		});
	}

	function getUsers() {
		jQuery.ajax({
			type : 'POST',
			contentType : 'application/json',
			url : '/demo/users',
			data : usersStr,
			dataType : 'json',
			success : function(data) {
				alert(dwr.util.toDescriptiveString(data, 3));
			},
			error : function() {
				alert("error");
			}
		});
	}

	//getUser();
	getUsers();
});